import java.util.Scanner;
 class  Loing{
    private static String an ="1234";
    private static String password ="1234";
    public static  void  loing(String a,String pass){
        if (!a.equals(an)) {
            //用户名有问题
            throw new UserException("用户名有问题");
        }
        if (!pass.equals(password)) {
            //用户名有问题
            throw new PassException("密码有问题");
        }
        System.out.println("成功登录");
    }
 }
 class UserException extends RuntimeException{
     public UserException (String messgs){
         super(messgs);
     }
 }
 class PassException extends RuntimeException{
     public PassException (String messgs){
         super(messgs);
     }
 }
public class Test {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入账号");
        String a = scanner.nextLine();
        System.out.println("请输入密码");
        String pass = scanner.nextLine();

        Loing.loing(a,pass);

    }
    /*//去重
    public  static  String fun(String a){
        boolean [] bool = new boolean[127];
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < a.length(); i++) {
            char ch = a.charAt(i);
            if (!bool[ch]) {
                stringBuilder.append(ch);
                bool[ch] = true;
            }
        }
        return  stringBuilder.toString();
    }
    public static void main(String[] args) {
        String a = "aabbccddef";
        String ret = fun(a);
        System.out.println(ret);

    }*/
    /*//回文
    public static boolean isNumChar(char s) {
        if(s >= '0' && s <= '9' || s >= 'a' && s <= 'z'){
            return true;
        }
        return false;
    }
    public static boolean sc(String s){
        s=s.toLowerCase();
        int i = 0;
        int j = s.length()-1;
        while (i < j) {
            while(i < j && !isNumChar(s.charAt(i))){
                i++;
            }
            while (i < j&& !isNumChar(s.charAt(j))){
                j--;
            }
            if (s.charAt(i)==s.charAt(j)) {
                i++;
                j--;
            }
            else
                return false;
        }
        return true;
    }

    public static void main(String[] args) {
        String  s = "A man,a plan,a canal:Panama";
        System.out.println(sc(s));
    }*/

    //统计最后一个单词长度
   /* public static void main(String[] args) {
        String s = "Hello World";
        int ret = s.lastIndexOf(' ');
        String str = s.substring(ret+1);
        System.out.println(str.length());
    }*/
    /*public int frequencySort(String s) {
        int [] count= new int[26];
        for(int i = 0; i < s.length(); i++){
            char ch = s.charAt(i);
            count[ch-'a']++;
        }
        for(int i = 0; i < s.length(); i++){
            char ch = s.charAt(i);
            if (count[ch-'a']==1) {
                return i;
            };
        }
        return  -1;
    }
    public static void main(String[] args) {
        Test test = new Test();
        int a =test.frequencySort("aaddeqq");
        System.out.println(a);*/

    /*//统计字符串中的单词个数，这里的单词指的是连续的不是空格的字符。
    //请注意，你可以假定字符串里不包括任何不可打印的字符。
    //示例:
    //输入: "Hello, my name is John"
    //输出: 5
    //解释: 这里的单词是指连续的不是空格的字符，所以 "Hello," 算作 1 个单词。
    public static void main(String[] args) {
        String s = "asdv qeq fd";
        if (s.equals(" ")) {
            return 0;
        }
        String [] ret = s.split(" ");
        int count = 0;
        for (int i = 0; i < str.length; i++) {
            if(str[i].isEmpty()) {
                continue;
            }
            count ++;
        }
        return count;
    }*/
   /* //给你一个字符串 s ，将该字符串中的大写字母转换成相同的小写字母，返回新的字符串。
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String a = scanner.nextLine();
        String ret = a.toLowerCase();
        System.out.println(ret);
    }*/

}